package com.xnyzc.lhy.order.common.userenum;

import com.xnyzc.lhy.common.exception.PangException;
import com.xnyzc.lhy.common.penum.EErrorCode;
import com.xnyzc.lhy.common.util.CheckUtil;

/**
 * @author cuixiaojian
 */
public enum EDriveVerfied {

    /**
     * 驾驶证状态
     */
    NO_UPLOAD(0, "未上传"),
    WAIT_APPLY(1, "待审核"),
    APPLY_OK(2, "审核通过"),
    APPLY_FILED(4, "审核失败"),
    ID_TIME_OUT(5, "驾照过期");;

    private Integer key;
    private String value;

    EDriveVerfied(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String value(Integer key) {
        if (CheckUtil.objIsNotEmpty(key)) {
            for (EDriveVerfied examine : EDriveVerfied.values()) {
                if (key.equals(examine.getKey())) {
                    return examine.getValue();
                }
            }
        }
        throw PangException.create(EErrorCode.noData);
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
